﻿namespace Dapper.Library
{
    public class SymbolInfo
    {
        public SymbolInfo(char openQuote, char closeQuote, char parameterPrefix)
        {
            OpenQuote = openQuote;
            CloseQuote = closeQuote;
            ParameterPrefix = parameterPrefix;
        }

        /// <summary>
        /// 开首引号
        /// </summary>
        public char OpenQuote { get; set; }

        /// <summary>
        /// 结束引号
        /// </summary>
        public char CloseQuote { get; set; }

        /// <summary>
        /// 参数前缀
        /// </summary>
        public char ParameterPrefix { get; set; }

        /// <summary>
        /// 合并字段名称
        /// </summary>
        /// <param name="field"></param>
        /// <returns></returns>
        public string CombineFieldName(string field)
        {
            return OpenQuote + field + CloseQuote;
        }
    }
}
